// components/action-sheet/index.js
Component({

  /**
   * 组件的属性列表
   */
  properties: {
    actionList: {
      type: Array,
      value: [
        {
          name: '选项',
          value: '1',
        }
      ]
    },
    showPanel: {
      type: Boolean,
      value: false,
      observer: function(val){
        this.setData({
          show: val
        })
      }
    },
    cancelText: {
      type: String ,
      value: '',
    }
  },

  /**
   * 组件的初始数据
   */
  data: {
    show: false,
  },

  /**
   * 组件的方法列表
   */
  methods: {
    showAction() {
      this.setData({ show: true });
    },
    onClose(e) {
      this.setData({ show: false });
      this.triggerEvent('doClose', { show: false });
      console.log('onClose', this.data.show)
    },
    onCancel() {
      this.setData({ show: false });
      console.log('onCancel', this.data.show)
      this.triggerEvent('doCancel', { show: false });
    },
    onSelect(event) {
      this.triggerEvent('doSelect', event.detail);
    },

  }
})